package com.twu.biblioteca.view.consoleUI.viewActions;

import com.twu.biblioteca.model.menu.Menu;
import com.twu.biblioteca.view.ViewAction;

import java.io.PrintStream;

public class ViewDetailsViewAction implements ViewAction {

    private final PrintStream output;
    private final Menu menu;

    public ViewDetailsViewAction(PrintStream output, Menu menu) {
        this.output = output;
        this.menu = menu;
    }

    @Override
    public void update(boolean success) {
        if (success) {
            output.println("Your Details:");
            output.println(menu.getLoggedInCustomer().toString());
        } else {
            output.println("No Customer Logged In.");
        }
    }
}
